package com.lanou.projecta_163news.adapter.MainAdapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by dllo on 16/3/7.
 */
public class MainFragmentTabAdapter extends FragmentPagerAdapter{
    private ArrayList<Fragment> maFrData;
    private String[] titles = {"实时","国家","军事","娱乐","科技","游戏","体育"};
    public MainFragmentTabAdapter(FragmentManager fm, ArrayList<Fragment> maFrData) {
        super(fm);
        this.maFrData = maFrData;

    }

    @Override
    public Fragment getItem(int position) {
        return maFrData.get(position);
    }

    @Override
    public int getCount() {
        return maFrData.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
